<!--#include file="../Common/Config.asp"-->
<!--#include file="../Common/Function.asp"-->
<!--#include file="../Common/HO_Log.asp"-->
<!--#include file="../Common/EasyIDE.asp"-->
<!--#include file="../Common/HO_Label.asp"-->
<!--#include file="../Common/HotTemplate.asp"-->
<!--#include file="../Common/Cache.asp"-->

<%
	OpenDB
	Dim PageTemplateDir
	Dim PageContent
	Dim Conn
	Set Conn = gConn
	PageTemplateDir =  "/HTMLTemplates/Template1/Products/Display.html" 
	PageContent = file_read(PageTemplateDir)
	PageContent = Label_ReplaceAllProductLabelsFromContent(PageContent)
 	PageContent = Label_ReplaceAllProductDetailLabelsFromContent(PageContent)
 
 
	Response.Write(PageContent)
	
 
	
	Function Label_ReplaceAllProductDetailLabels(ByVal T)
		Dim ProductID
		Dim rs 
		Dim sql
		Dim label
		Dim i
		ProductID = SqlValue(Request.QueryString("ID"),1)
		Sql = "Select * From HO_Products Where ProductID = " & ProductID
		gConn.execute "update HO_Products set Producthits = Producthits + 1 where ProductID=" & ProductID
		Set rs = gConn.Execute(Sql)
		If Not (rs.Eof) Then
			For i = 0 to rs.Fields.Count - 1				 
				label = gLabelPrefix & rs.Fields(i).name & gLabelSuffix			
				T = HO_ReplaceText(T,label, rs(i) )				 
			Next	
		End If
		Label_ReplaceAllProductDetailLabels = T	
 
	End Function
	Function Label_ReplaceAllProductDetailLabelsFromContent(ByVal FileContent)
		Dim ColumnID
		Dim tp
		Dim rowNum
		Dim j,i
		Set tp = new hotTemplate
		tp.Content = FileContent
		tp.Content = Label_ReplaceAllUserLabels(tp.Content)
		tp.Content = Label_ReplaceAllSystemLabels(tp.Content)		
		tp.Content = Label_ReplaceAllProductDetailLabels(tp.Content)
		
		ColumnID = GetColumnID()
		Dim sqlwhere 
		sqlwhere = " ProductFlag = 1 "
		If ColumnID <> 0 Then 
			sqlwhere = sqlwhere & " And ColumnID="& ColumnID
		End If
		
		'Response.write Sql
	 	Dim rs
		 
	 	'Set rs = Server.CreateObject("adodb.recordset")
		'rs.Open "SELECT ColumnID AS MenuColumnID,ColumnName AS MenuColumnName From Syscolumn where Columnparentid=5 order by Columnorder asc",gConn,1,1
		'rowNum = rs.Recordcount		
		'Response.write rs.Recordcount
		'tp.set_block "productcolumn"
		'j = 0
		'If Not (rs.Eof) Then
		'	Do until rs.eof 
		'		j = j + 1
		'		For i = 0 to rs.Fields.Count - 1
		'			tp.set_bvar rs.Fields(i).name,rs(i)					 
		'		Next
 '
'				tp.prase_block(rowNum-j )
'				rs.MoveNext
'			Loop			
'		End If
		
		
'	 	rs.Close()
		'tp.set_var "HO_TITLE","Heoffice"
		'tp.loadfile_fromcache "t.htm"
		tp.prase_file()
		Label_ReplaceAllProductDetailLabelsFromContent = tp.Content 
	End Function
	
%>